package com.hezhou.oauth2.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hezhou.oauth2.web.entities.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * ---------------------------
 * (SysPermissionMapper) 系统权限映射层
 * ---------------------------
 *
 * @Author: [hezhou]
 * @Date: 2020/3/6
 * @Version: [1.0.1]
 * ---------------------------
 */
@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    /**
     * 根据用户id查询出他的权限
     * @param userId
     * @return
     */
    List<SysPermission> selectPermissionByUserId(@Param("userId") Long userId);

    /**
     * 根据用户的电话查询出他的权限
     * @param mobile
     * @return
     */
    List<SysPermission> selectPermissionByMobile(@Param("mobile") String mobile);

    /**
     * 删除角色权限
     * @param id
     * @return
     */
    List<SysPermission> findRolePermissionById(@Param("id") Long id);
}
